<template>
  <view class="broadcasts">
    <view class="items">
      <view class="note">
        <image class="icon" mode="aspectFit" src="/static/images/note.png" ></image>
        <image class="word" mode="aspectFit" src="/static/images/inform.png"></image>
        <view class="line">|</view>
        <view class="text">
          <swiper class="swiper" :vertical="true" :indicator-dots="false" :autoplay="true" :interval="6000" :duration="1000" :circular="true" :touchable="false" >
            <swiper-item v-for="broadcast in broadcasts" :key="broadcast.id" @tap="showMessage(broadcast.message)">
              <view class="swiper-item"  >
                <view class="message">{{ broadcast.message }}</view>
              </view>
            </swiper-item>
          </swiper>
        </view>
      </view>
    </view>
	<view class="msg-pop">
		 <uni-popup ref="msgpopup" type="center">
			 <view class="popbgmsg-box" @click="close()">
				 <image src="/static/images/popbgmsg.png" class="popbgmsg" mode=""></image>
				 <view class="pop-content">{{ popContent }}</view>
			 </view>
		 </uni-popup>
	</view>
  </view>
</template>

<script>
export default {
  name: "BroadcastCom",
  props: {
    broadcasts: {
      type: Array,
      default: []
    }
  },
  data(){
	return {
		popContent:''
	}  
  },
  methods: {
    showMessage(message) {
      uni.showModal({
        title: '通知',
        content: message,
        showCancel: false,
        confirmText: '我知道了'
      })
    },
	close(){
		this.$refs.msgpopup.close()
	},
	showmsg(message){
		this.popContent = message
		this.$refs.msgpopup.open('center')
	}
  }
}
</script>

<style lang="scss" scoped>
.broadcasts {
	
  .items {
    .note {
      width: 100%;
      height: 76rpx;
      font-size: 24rpx;
      color: #333333;
      display: flex;
      align-items: center;
      background: #FFEBE4;
      border-radius: 16rpx;
      .icon {
        width: 32rpx;
        height: 32rpx;
        margin-left: 20rpx;
        margin-right: 10rpx;
      }
      .word {
        width: 54rpx;
        height: 32rpx;
        margin-right: 10rpx;
      }
      .line {
        margin-right: 10rpx;
      }
      .text {
        width: 95%;
        height: 68rpx;
        line-height: 68rpx;
        font-size: 24rpx;
        color: #333333;
        .swiper {
          height: 68rpx;
          .swiper-item {
            .message {
              font-size: 24rpx;
              font-weight: 400;
              color: #333333;
            }
          }
        }
      }
    }
  }
}
.popbgmsg-box{
	width: 560rpx;
	height: 980rpx;
	margin-top: 50rpx;
	position: relative;
	
}
.popbgmsg{
	display: block;
	width: 560rpx;
	height: 980rpx;
}
.pop-content{
	width: 354rpx;
	max-height: 260rpx;
	text-overflow: -o-ellipsis-lastline;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	line-clamp: 6;
	-webkit-box-orient: vertical;
	position: absolute;
	left:104rpx;
	top:344rpx;
	font-size: 28rpx;
	font-family: PingFangSC-Regular, PingFang SC;
	font-weight: 400;
	color: #A73501;
	line-height: 40rpx;
	
	
}
</style>
